package com.guochenglang.www.service;

import com.guochenglang.www.pojo.Member;
import com.guochenglang.www.service.anotate.Affair;

import java.sql.SQLException;
import java.util.ArrayList;

/**
 * @author GuoChenglang
 */
public interface MemberService {

    /**
     * 更改成员状态
     *
     * @param newMember 更改的信息
     * @param userId    用户id
     * @return 更改的行数
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    @Affair
    int changeMember(Member newMember, int userId) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 删除成员
     *
     * @param memberId 成员id
     * @param userId   执行者用户id
     * @return 删除行数
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    @Affair
    int deleteMember(int memberId, int userId) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 获得知识库成员列表
     *
     * @param conditions 搜索条件
     * @return 成员列表
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    ArrayList<Member> baseMemberList(Member conditions) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

}
